home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / string.n < prev    next >
Text File  |  1995-07-25  |  8KB  |  199 lines

  1.  
  2.  
  3.  
  4.      ssssttttrrrriiiinnnngggg((((nnnn))))                    TTTTccccllll (((( ))))                    ssssttttrrrriiiinnnngggg((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           string - Manipulate strings
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           ssssttttrrrriiiinnnngggg _o_p_t_i_o_n _a_r_g ?_a_r_g ...?
  15.      _________________________________________________________________
  16.  
  17.  
  18.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.           Performs one of  several  string  operations,  depending  on
  20.           _o_p_t_i_o_n.  The legal _o_p_t_i_o_ns (which may be abbreviated) are:
  21.  
  22.           ssssttttrrrriiiinnnngggg ccccoooommmmppppaaaarrrreeee _s_t_r_i_n_g_1 _s_t_r_i_n_g_2
  23.                Perform a character-by-character comparison of  strings
  24.                _s_t_r_i_n_g_1  and  _s_t_r_i_n_g_2  in  the same way as the C ssssttttrrrrccccmmmmpppp
  25.                procedure.  Return -1, 0, or 1,  depending  on  whether
  26.                _s_t_r_i_n_g_1  is  lexicographically  less than, equal to, or
  27.                greater than _s_t_r_i_n_g_2.
  28.  
  29.           ssssttttrrrriiiinnnngggg ffffiiiirrrrsssstttt _s_t_r_i_n_g_1 _s_t_r_i_n_g_2
  30.                Search  _s_t_r_i_n_g_2  for  a  sequence  of  characters  that
  31.                exactly  match  the  characters  in _s_t_r_i_n_g_1.  If found,
  32.                return the index of the first character  in  the  first
  33.                such match within _s_t_r_i_n_g_2.  If not found, return -1.
  34.  
  35.           ssssttttrrrriiiinnnngggg iiiinnnnddddeeeexxxx _s_t_r_i_n_g _c_h_a_r_I_n_d_e_x
  36.                Returns  the  _c_h_a_r_I_n_d_e_x'th  character  of  the   _s_t_r_i_n_g
  37.                argument.   A  _c_h_a_r_I_n_d_e_x  of 0 corresponds to the first
  38.                character of the string.  If _c_h_a_r_I_n_d_e_x is less  than  0
  39.                or  greater  than  or equal to the length of the string
  40.                then an empty string is returned.
  41.  
  42.           ssssttttrrrriiiinnnngggg llllaaaasssstttt _s_t_r_i_n_g_1 _s_t_r_i_n_g_2
  43.                Search  _s_t_r_i_n_g_2  for  a  sequence  of  characters  that
  44.                exactly  match  the  characters  in _s_t_r_i_n_g_1.  If found,
  45.                return the index of the first  character  in  the  last
  46.                such  match within _s_t_r_i_n_g_2.  If there is no match, then
  47.                return -1.
  48.  
  49.           ssssttttrrrriiiinnnngggg lllleeeennnnggggtttthhhh _s_t_r_i_n_g
  50.                Returns  a  decimal  string  giving   the   number   of
  51.                characters in _s_t_r_i_n_g.
  52.  
  53.           ssssttttrrrriiiinnnngggg mmmmaaaattttcccchhhh _p_a_t_t_e_r_n _s_t_r_i_n_g
  54.                See if _p_a_t_t_e_r_n matches _s_t_r_i_n_g; return 1 if it  does,  0
  55.                if  it  doesn't.  Matching is done in a fashion similar
  56.                to that used by the C-shell.  For the  two  strings  to
  57.                match, their contents must be identical except that the
  58.                following special sequences may appear in _p_a_t_t_e_r_n:
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/17/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      ssssttttrrrriiiinnnngggg((((nnnn))))                    TTTTccccllll (((( ))))                    ssssttttrrrriiiinnnngggg((((nnnn))))
  71.  
  72.  
  73.  
  74.                ****         Matches any sequence of characters in _s_t_r_i_n_g,
  75.                          including a null string.
  76.  
  77.                ????         Matches any single character in _s_t_r_i_n_g.
  78.  
  79.                [[[[_c_h_a_r_s]]]]   Matches any character in  the  set  given  by
  80.                          _c_h_a_r_s.  If a sequence of the form _x----_y appears
  81.                          in _c_h_a_r_s, then any character between _x and _y,
  82.                          inclusive, will match.
  83.  
  84.                \\\\_x        Matches  the  single   character   _x.    This
  85.                          provides   a  way  of  avoiding  the  special
  86.                          interpretation of  the  characters  ****????[[[[]]]]\\\\  in
  87.                          _p_a_t_t_e_r_n.
  88.  
  89.           ssssttttrrrriiiinnnngggg rrrraaaannnnggggeeee _s_t_r_i_n_g _f_i_r_s_t _l_a_s_t
  90.                Returns a range of consecutive characters from  _s_t_r_i_n_g,
  91.                starting  with  the  character whose index is _f_i_r_s_t and
  92.                ending with the character  whose  index  is  _l_a_s_t.   An
  93.                index of 0 refers to the first character of the string.
  94.                _L_a_s_t may be eeeennnndddd (or any abbreviation of it) to refer to
  95.                the  last  character  of  the string.  If _f_i_r_s_t is less
  96.                than zero then it is treated as if it were zero, and if
  97.                _l_a_s_t  is  greater  than  or  equal to the length of the
  98.                string then it is treated as if it were eeeennnndddd.  If  _f_i_r_s_t
  99.                is greater than _l_a_s_t then an empty string is returned.
  100.  
  101.           ssssttttrrrriiiinnnngggg ttttoooolllloooowwwweeeerrrr _s_t_r_i_n_g
  102.                Returns a value equal to _s_t_r_i_n_g except that  all  upper
  103.                case letters have been converted to lower case.
  104.  
  105.           ssssttttrrrriiiinnnngggg ttttoooouuuuppppppppeeeerrrr _s_t_r_i_n_g
  106.                Returns a value equal to _s_t_r_i_n_g except that  all  lower
  107.                case letters have been converted to upper case.
  108.  
  109.           ssssttttrrrriiiinnnngggg ttttrrrriiiimmmm _s_t_r_i_n_g ?_c_h_a_r_s?
  110.                Returns a value equal to _s_t_r_i_n_g except that any leading
  111.                or  trailing characters from the set given by _c_h_a_r_s are
  112.                removed.  If _c_h_a_r_s is not specified then white space is
  113.                removed (spaces, tabs, newlines, and carriage returns).
  114.  
  115.           ssssttttrrrriiiinnnngggg ttttrrrriiiimmmmlllleeeefffftttt _s_t_r_i_n_g ?_c_h_a_r_s?
  116.                Returns a value equal to _s_t_r_i_n_g except that any leading
  117.                characters from the set given by _c_h_a_r_s are removed.  If
  118.                _c_h_a_r_s is not specified  then  white  space  is  removed
  119.                (spaces, tabs, newlines, and carriage returns).
  120.  
  121.           ssssttttrrrriiiinnnngggg ttttrrrriiiimmmmrrrriiiigggghhhhtttt _s_t_r_i_n_g ?_c_h_a_r_s?
  122.                Returns  a  value  equal  to  _s_t_r_i_n_g  except  that  any
  123.                trailing  characters  from  the  set given by _c_h_a_r_s are
  124.                removed.  If _c_h_a_r_s is not specified then white space is
  125.                removed (spaces, tabs, newlines, and carriage returns).
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/17/95)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      ssssttttrrrriiiinnnngggg((((nnnn))))                    TTTTccccllll (((( ))))                    ssssttttrrrriiiinnnngggg((((nnnn))))
  137.  
  138.  
  139.  
  140.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  141.           case conversion, compare, index, match, pattern, string
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 7/17/95)
  196.  
  197.  
  198.  
  199.